package io.gitee.kotle.base.library

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import io.gitee.kotle.android.delegate.unsafeLazy
import io.gitee.kotle.android.utils.invisible
import io.gitee.kotle.android.widget.BaseFrameLayout
import io.gitee.kotle.base.databinding.ModuleBaseViewBaseUiErrorBinding
import io.gitee.kotle.base.databinding.ModuleBaseViewBaseUiLoadingBinding

/**
 *
 * 描述：
 *
 * 创建人：jiale.wei
 * 创建时间：2021/11/23 11:08 上午
 *
 */
class BaseUiView : BaseFrameLayout {
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    val loadingBinding by unsafeLazy {
        ModuleBaseViewBaseUiLoadingBinding.inflate(
            LayoutInflater.from(
                context
            ), this, true
        )
    }

    val errorBinding by unsafeLazy {
        ModuleBaseViewBaseUiErrorBinding.inflate(
            LayoutInflater.from(
                context
            ), this, true
        )
    }
}